<template>
 <view class="fixtitle">
 	     <view class="" :style="{height:getstateheight()+'px'}"></view>
 		 <view class="titletop"  :style="{height:gettitileheight()+'px'}">
 			   <view class="">消息中心</view>
 		 </view>
 </view>
 <view class="" :style="{height:scrollheight}"></view>
 <view class="con" v-if="useltstore.data.length">
	 <view  v-for="(i,index) in useltstore.data" :key="index" >
                 <view @click="goliaot(i)" class="item" v-if="useltstore.shortdatae(i.shou.id)[0] && i.shou.id!==useuserstore.userlogin.id">
					 <ltcardVue  :id="i.shou.id" :text="useltstore.shortdatae(i.shou.id)[0]"/>
				 </view>
	 </view>
 </view> 
 <view class="con" v-else>
 	   <view class="nomre">
		   暂无消息
	   </view>
 </view>
</template>

<script setup>

	import ltcardVue from '../../components/ltcard/ltcard.vue';
	import { ip } from '@/utils/getinfo.js';
	import {getstateheight,gettitileheight} from '@/utils/getinfo.js'
	const scrollheight=getstateheight()+gettitileheight()+'px'
	import {userfind} from '@/api/index.js'
	import ltstore from '@/store/lt.js'
	import userstore from '@/store/userlogin.js'
	const useuserstore=userstore()
	const useltstore=ltstore()
	const goliaot=async i=>{
		const rudata=await userfind(i.shou.id)
		console.log(i)
		uni.navigateTo({
			url:`/pages/liaot/liaot?id=${i.shou.id}&name=${rudata.data.name}&img=${rudata.data.img}`
		})
	}
</script>

<style lang="scss" scoped>
	.fixtitle{
		position: fixed;
		top: 0;
		width: 100%;
		background-color: #f7f7f7;
		.titletop{
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 25rpx;
		}
	}
	.con{
		height: calc(100vh - v-bind(scrollheight));
		background-color: #f7f7f7;
		overflow: auto;
		&::-webkit-scrollbar{
			display: none;
		}
		padding: 10rpx 40rpx;
		.item{
			width: 100%;
			height: 130rpx;
			background-color: #fff;
			border-radius: 20rpx;
			margin-bottom: 20rpx;
		}
	}
</style>
